const greenText = (text) => `\x1b[32m${text}\x1b[0m`

const config = {
  appName: '瞬影工坊',
  appLogo: 'logo3.png',
  showViteLogo: true,
  logs: [],
  version: 'v2.8.2',
  links: {
    github: 'https://github.com/flipped-aurora/gin-vue-admin',
    plugin: 'https://plugin.gin-vue-admin.com',
    community: 'https://support.qq.com/products/371961',
    empower: 'https://gin-vue-admin.com/empower/index.html'
  },
  contact: {
    wechat: 'shouzi_1994',
    qq: '470239250'
  },
  copyright: {
    owner: '高能现场',
    company: '高能现场'
  }
}

export const viteLogo = (env) => {
  if (!config.showViteLogo) return

  const { github, plugin, community, empower } = config.links
  const { wechat, qq } = config.contact
  const { owner, company } = config.copyright

  const lines = [
    `> 欢迎使用Gin-Vue-Admin，开源地址：${github}`,
    `> 当前版本: ${config.version}`,
    `> 加群方式: 微信：${wechat} QQ群：${qq}`,
    `> 项目地址：${github}`,
    `> 插件市场: ${plugin}`,
    `> GVA讨论社区: ${community}`,
    `> 默认自动化文档地址: http://127.0.0.1:${env.VITE_SERVER_PORT}/swagger/index.html`,
    `> 默认前端文件运行地址: http://127.0.0.1:${env.VITE_CLI_PORT}`,
    `--------------------------------------版权声明--------------------------------------`,
    `** 版权所有方：${owner} **`,
    `** 版权持有公司：${company} **`,
    `** 剔除授权标识需购买商用授权：${empower} **`,
    ''
  ]

  lines.forEach(line => console.log(greenText(line)))
}

export default config